package de.gwtprime.client.event;

import com.google.gwt.event.shared.GwtEvent;

import de.gwtprime.client.event.handler.AnswerAddedEventHandler;
import de.gwtprime.shared.requestFactory.AnswerProxy;

public class AnswerAddedEvent extends GwtEvent<AnswerAddedEventHandler>{
	
	public static Type<AnswerAddedEventHandler> TYPE = new Type<AnswerAddedEventHandler>(); 
	
	private AnswerProxy answer;
	
	public AnswerAddedEvent(AnswerProxy answer) {
		this.setAnswer(answer);
	}

	@Override
	protected void dispatch(AnswerAddedEventHandler handler) {
		handler.onAnswerAdded(this);
	}

	@Override
	public Type<AnswerAddedEventHandler> getAssociatedType() {
		return TYPE;
	}

	public AnswerProxy getAnswer() {
		return answer;
	}

	public void setAnswer(AnswerProxy answer) {
		this.answer = answer;
	}


}
